package com.ray.bean;

import java.util.Map;

import org.springframework.util.Assert;

import lombok.Getter;
import lombok.Setter;

/**
 * 公司物料类型配置实体类
* <p>Title: CompanyMaterialTypeBean</p>  
* <p>Description: </p>  
* @author 李斌  
* @date 2018年10月8日
 */
@Setter
@Getter
public class CompanyMaterialTypeBean {
	//id
	private String id;
	//物料类型
	private String materialType;
	//是否读取颜色
	private Integer isReadColor;
	//公司
	private String company;
	//来源类型 如果公司自己添加? 1是 2不是 
	private Integer isSelfAdded;
	//状态
	private Integer status;
	//创建人
	private String createUser;
	//创建时间
	private String createTime;
	//最后一次修改人
	private String lastModifier;
	//最后一次修改时间
	private String lastModifiedTime; 
	//默认仓位 1原材料仓 2辅料仓 3信息备注仓
	private Integer defaultWarehouse;
	//是否在制单页面显示
	private Integer createOrderIsShow;
	
	//传入Map
	public CompanyMaterialTypeBean(Map<String, String> map) {
		Assert.notNull(map.get("isReadColor"),"该物料类型是否读颜色为空");
		Assert.notNull(map.get("loginCompany"),"公司名为空");
		Assert.notNull(map.get("loginUserId"),"用户id为空");
		Assert.notNull(map.get("status"),"状态为空");
		Assert.notNull(map.get("defaultWarehouse"),"仓位为空");
		Assert.notNull(map.get("createOrderIsShow"),"制单页面是否显示为空");
		setMaterialType(map.get("materialType"));
		setIsReadColor(Integer.valueOf(map.get("isReadColor")));
		setIsSelfAdded(1);
		setCompany(map.get("loginCompany"));
		setStatus(Integer.valueOf(map.get("status")));
		setCreateUser(map.get("loginUserId"));
		setCreateTime(map.get("createTime"));
		setDefaultWarehouse(Integer.valueOf(map.get("defaultWarehouse")));
		setCreateOrderIsShow(Integer.valueOf(map.get("createOrderIsShow")));
	}
	
	public CompanyMaterialTypeBean() {
		// TODO Auto-generated constructor stub
	}
}
